/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Core.Event;
import java.util.ArrayList;




/**
 *
 * @author GRADY
 */
public class EventHandler {
    ArrayList<Event> events;
    private static EventHandler instance;

    private void EventHandler() {
        
    }
    public void setNewEvent(Event eventObject) {
        this.events.add(eventObject);
    }
    public static EventHandler getInstance() {
        if(instance == null) {
            instance = new EventHandler();
        }
        return instance;
    }
    public Event getEvent(Event event) {
        int foundindex = 0;
        Boolean found = false;
        for(int i=0;i<=events.size();i++) {
           if(events.get(i).equals(event)) {
               foundindex = i;
               found = true;
           }
        }
        if(found == true) {
            return events.get(foundindex);
        }
        return null;
        //test
    }

}
